<template>
    <div class="aptitudeEdit">
         <!-- <mt-header :title="title">
            <router-link to="/" slot="left">
                <mt-button icon="back"></mt-button>
            </router-link>
        </mt-header> -->
        <div class="content">
            <div class="title">{{item.name}}</div>
            <div class="time">创建日期：{{format(item.creationTime)}}</div>
            <div v-html="item.content"></div>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            title:'详情',
            item:'',
        }
    },
    mounted(){
        this.item=this.$route.query.p
        console.log(this.item)
    },
    methods:{
        format(shijianchuo) {
            var time = new Date(shijianchuo*1000);
            var y = time.getFullYear();
            var m = time.getMonth() + 1;
            var d = time.getDate();
            var h = time.getHours();
            var f = time.getMinutes();
            var s = time.getSeconds();
            //想要什么格式可以自己改
            return y + '-' + this.add0(m) + '-' + this.add0(d);
            // return y + '-' + this.add0(m) + '-' + this.add0(d) +" "+ this.add0(h)+':'+this.add0(f)+':'+this.add0(s);
        },
        //小于10的时候，前边加0（08：08：12）
        add0(m) {
            return m < 10 ? '0' + m : m
        },
    },
    watch:{
        
    }
}
</script>

<style scoped>
.aptitudeEdit{
    background: #f7f7f8;
    min-height: 100vh;
}
.content{
    padding: .2rem;
    background: #fff;
    min-height: 100vh;
    margin-top: .15rem;
}
.title{
    text-align: center;
    margin-bottom: .2rem;
    margin-top: .2rem;
}
.time{
    margin-top: .4rem;
    margin-bottom: .2rem;
    /* text-align: center; */
    color: #999;
    font-size: 12px;
}
</style>